package com.ysl.study.designpattern.createmode.abstractfactory;

import com.ysl.study.designpattern.createmode.simplefactory.Color;
import com.ysl.study.designpattern.createmode.simplefactory.Shape;

/**
 * All right reserved by QUICKSWAN. from 2012
 *
 * @author yangshanlin
 * @date 2023/2/17 15:37
 * @describe
 */
public class AbstractFactoryTest {

    public static void main(String[] args) {
        FactoryProducer producer = new FactoryProducer();
        AbstractFactory colorFactory = producer.getAbstractFactory("color");
        Color color = colorFactory.getColorFactory("red");
        color.createColor();

        AbstractFactory shapeFactory = producer.getAbstractFactory("shape");
        Shape shape = shapeFactory.getShapeFactory("circle");
        shape.draw();
    }
}
